using Abp.Application.Services;
using Abp.Application.Services.Dto;
using L._52ABP.Application.Dtos;
using L._52ABP.Application.HangFire.Dtos;

namespace Yozeev.Service
{
    /// <summary>
    /// Hangfire服务
    /// </summary>
    public interface IHangfireService : IApplicationService
    {
        /// <summary>
        /// 获取所有周期性作业
        /// </summary>
        /// <returns></returns>
        RecurringResultList GetAllRecurringJob(PagedSortedAndFilteredInputDto input);
        /// <summary>
        /// 获取所有普通作业
        /// </summary>
        /// <returns></returns>
        PagedResultDto<HangFireStorageJob> GetAllJobs(JobInput input);

        /// <summary>
        /// 获取所有服务
        /// </summary>
        /// <returns></returns>
        ServerResultList GetServer();

        /// <summary>
        /// 获取作业详细信息
        /// </summary>
        /// <param name="input"></param>
        HangfireJobDetailDto GetJobDetail(EntityDto<string> input);

        /// <summary>
        /// 删除周期性作业
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        bool DeleteRecurringJob(RecurringJobInput input);

        /// <summary>
        /// 执行作业
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        bool RunRecurringJob(RecurringJobInput input);

        /// <summary>
        /// 重新加入队列
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        bool Requeue(RecurringJobInput input);

        /// <summary>
        /// 删除普通作业
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        bool DeleteJob(RecurringJobInput input);

        /// <summary>
        /// 获取Dashboard仪表盘-数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        DashboardIndexDetailDto GetDashboardData(DashboardIndexDto input);
        /// <summary>
        /// 获取统计数据
        /// </summary>
        /// <returns></returns>
        StatisticsInfoDto GetDashboardStatistics();

        /// <summary>
        /// 获取重试的作业数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        RetriesResultList GetRetriesJob(PagedSortedAndFilteredInputDto input);

        /// <summary>
        /// 加入队列
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        bool AddEnqueueJob(RecurringJobInput input);
    }

}
